<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <!-- google_ad_section_start -->
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>HOMMKALC - Simulateur de combat pour Heroes of Might and Magic : Kingdom (HOMMK)</title>
        <meta http-equiv="Description" content="Calculateur de rapports de combat pour le jeu HOMMK ( Heroes of Might and Magic : Kingdom, jeu en ligne par navigateur massivement multijoueur). Permet de parametrer les heros, et de choisir les creatures parmis la liste complete de creatures du Havre, de l'Inferno, de la Necropole, ou de l'Academie.">
        <meta http-equiv="Keywords" content="HOMMK, HOMM, Jeu, Online, Html, Heroes, Might, Magic, Kingdom, Calculateur, Simulateur, Rapport, Combat, Magie, XP, Honneur, Travian, Ogame, Projet42, Hordes, Skywar, Navigateur, Havre, Inferno, Necropole, Academie, MMO, MMORTS, MMORPG">
        <!-- google_ad_section_end -->
        <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
        <link rel="stylesheet" href="css/style.css">
    </head
    <body>
        <div class="header">
            <h1>HOMMKALC</h1>
            Simulateur de combat pour <b>HOMMK (Heroes of Might and Magic : Kingdom)</b>
            <br/><br/>
            <script type="text/javascript"><!--
                google_ad_client = "pub-6455100480774433";
                /* 728x90, date de création 01/07/09 */
                google_ad_slot = "2190260860";
                google_ad_width = 728;
                google_ad_height = 90;
                //-->
            </script>
            <script type="text/javascript"
                    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
        </div>
        <br />
        <form action="index.php" method="POST" class="battle_form">
            <table cellspacing="0" class="heroes">
                <tr>
                    <td><h2 class="attacker">Hero Attaquant</h2></td>
                    <td></td>
                    <td width="50px"></td>
                    <td><h2 class="defender">Hero Defenseur</h2></td>
                    <td></td>
                </tr>
                <tr>
                    <td>Race</td>
                    <td>
                        <?php $partial_field_name = "attacker_race" ?>
                        <?php $partial_options = array(_RACE_UNDEFINED_ => '',
                                                       _RACE_ACADEMY_ => 'Academie', _RACE_HAVRE_ => 'Havre',
                                                       _RACE_INFERNO_ => 'Inferno', _RACE_NECRO_ => 'Necropole') ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                    <td></td>
                    <td>Race</td>
                    <td>
                        <?php $partial_field_name = "defender_race" ?>
                        <?php $partial_options = array(_RACE_UNDEFINED_ => '',
                                                       _RACE_ACADEMY_ => 'Academie', _RACE_HAVRE_ => 'Havre',
                                                       _RACE_INFERNO_ => 'Inferno', _RACE_NECRO_ => 'Necropole') ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                </tr>
                <tr>
                    <td>Niveau d'Attaque (0-60)</td>
                    <td><input type="text" name="attacker_attack_level" value="<?php echo isset($_REQUEST["attacker_attack_level"]) ? $_REQUEST["attacker_attack_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Defense (0-60)</td>
                    <td><input type="text" name="defender_defence_level" value="<?php echo isset($_REQUEST["defender_defence_level"]) ? $_REQUEST["defender_defence_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau de Magie (0-60)</td>
                    <td><input type="text" name="attacker_magic_level" value="<?php echo isset($_REQUEST["attacker_magic_level"]) ? $_REQUEST["attacker_magic_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Magie (0-60)</td>
                    <td><input type="text" name="defender_magic_level" value="<?php echo isset($_REQUEST["defender_magic_level"]) ? $_REQUEST["defender_magic_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau de Harangueur (1-3)</td>
                    <td><input type="text" name="attacker_harangue_level" value="<?php echo isset($_REQUEST["attacker_harangue_level"]) ? $_REQUEST["attacker_harangue_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Bon Payeur (1-3)</td>
                    <td><input type="text" name="defender_goodpay_level" value="<?php echo isset($_REQUEST["defender_goodpay_level"]) ? $_REQUEST["defender_goodpay_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau de Tacticien (1-3)</td>
                    <td><input type="text" name="attacker_tactician_level" value="<?php echo isset($_REQUEST["attacker_tactician_level"]) ? $_REQUEST["attacker_tactician_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Tacticien en Defense (1-3)</td>
                    <td><input type="text" name="defender_tactician_level" value="<?php echo isset($_REQUEST["defender_tactician_level"]) ? $_REQUEST["defender_tactician_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau d'Ecuyer (1-3)</td>
                    <td><input type="text" name="attacker_rider_level" value="<?php echo isset($_REQUEST["attacker_rider_level"]) ? $_REQUEST["attacker_rider_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau d'Ecuyer (1-3)</td>
                    <td><input type="text" name="defender_rider_level" value="<?php echo isset($_REQUEST["defender_rider_level"]) ? $_REQUEST["defender_rider_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau de Tireur d'Elite (1-3)</td>
                    <td><input type="text" name="attacker_marksman_level" value="<?php echo isset($_REQUEST["attacker_marksman_level"]) ? $_REQUEST["attacker_marksman_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Tireur d'Elite (1-3)</td>
                    <td><input type="text" name="defender_marksman_level" value="<?php echo isset($_REQUEST["defender_marksman_level"]) ? $_REQUEST["defender_marksman_level"] : 0?>" /></td>
                </tr>
                <tr>
                    <td>Niveau de Commandant d'Infanterie (1-3)</td>
                    <td><input type="text" name="attacker_infantry_level" value="<?php echo isset($_REQUEST["attacker_infantry_level"]) ? $_REQUEST["attacker_infantry_level"] : 0?>" /></td>
                    <td></td>
                    <td>Niveau de Commandant d'Infanterie (1-3)</td>
                    <td><input type="text" name="defender_infantry_level" value="<?php echo isset($_REQUEST["defender_infantry_level"]) ? $_REQUEST["defender_infantry_level"] : 0?>" /></td>
                </tr>
            </table>




            <br />
            <br />




            <table width="900px" cellspacing="0" class="armies">
                <tr class="head">
                    <td colspan="2" class="attacker"><h2>Attaquant</h2></td>
                    <td colspan="1"></td>
                    <td colspan="2" class="defender"><h2>Defenseur</h2></td>
                </tr>
                <tr>

                    <td class="attacker"><b>Classe</b></td>
                    <td class="attacker"><b>Quantite</b></td>
                    <td width="150px"></td>
                    <td class="defender"><b>Quantite</b></td>
                    <td class="defender"><b>Classe</b></td>

                </tr>
                <?php for($i = 0; $i < 7; $i++): ?>
                <tr>
                    <td class="attacker">
                        <?php $partial_field_name = "attacker_class_$i" ?>
                        <?php $partial_options = $units_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                    <td class="attacker quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="attacker_quantity_<?php echo $i ?>" value="<?php echo @$_REQUEST["attacker_quantity_$i"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td></td>
                    <td class="defender quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="defender_quantity_<?php echo $i ?>" value="<?php echo @$_REQUEST["defender_quantity_$i"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td class="defender">
                        <?php $partial_field_name = "defender_class_$i" ?>
                        <?php $partial_options = $units_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                </tr>
                <?php endfor; ?>
                <tr>
                    <td class="attacker"><b>Magie (EXPERIMENTAL)</b></td>
                    <td class="attacker"><b>Tour</b></td>
                    <td width="150px"></td>
                    <td class="defender"><b>Tour</b></td>
                    <td class="defender"><b>Magie (EXPERIMENTAL)</b></td>
                </tr>
                <tr>
                    <td class="attacker">
                        <?php $partial_field_name = "attacker_magic_1" ?>
                        <?php $partial_options = $magics_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                    <td class="attacker quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="attacker_magic_turn_1" value="<?php echo @$_REQUEST["attacker_magic_turn_1"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td>
                    </td>
                    <td class="defender quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="defender_magic_turn_1" value="<?php echo @$_REQUEST["defender_magic_turn_1"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td class="defender">
                        <?php $partial_field_name = "defender_magic_1" ?>
                        <?php $partial_options = $magics_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                </tr>
                <tr>
                    <td class="attacker">
                        <?php $partial_field_name = "attacker_magic_2" ?>
                        <?php $partial_options = $magics_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                    <td class="attacker quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="attacker_magic_turn_2" value="<?php echo @$_REQUEST["attacker_magic_turn_2"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td>
                    </td>
                    <td class="defender quantity">
                        <input type="button" class="plus" value="+"></input>
                        <input type="text" class="value" name="defender_magic_turn_2" value="<?php echo @$_REQUEST["defender_magic_turn_2"]?>" />
                        <input type="button" class="minus" value="-"></input>
                    </td>
                    <td class="defender">
                        <?php $partial_field_name = "defender_magic_2" ?>
                        <?php $partial_options = $magics_display ?>
                        <?php include 'view/partial/select.phtml' ?>
                    </td>
                </tr>
            </table>



            <div class="slot_simulation">
                <?php include 'view/battlereport.phtml' ?>
            </div>



        </form>





        <div class="footer">
            <script type="text/javascript"><!--
                google_ad_client = "pub-6455100480774433";
                /* 728x90, date de création 04/07/09 */
                google_ad_slot = "6392535776";
                google_ad_width = 728;
                google_ad_height = 90;
                //-->
            </script>
            <script type="text/javascript"
                    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
            <br/>
            <!-- google_ad_section_start -->
            fait par Valerian Gaudeau, grace a l'aide precieuse des developpeurs de la communaute de HOMMK
            (valerian (at) gaudeau (point) fr)<br/>
            <br/>
            <span class="description">
                Simulateur de combat pour Heroes of Might and Magic : Kingdom.
                Customisation des Heros,
                choix des armees, bonus de la roue des armes, overrun, calcul de l'experience et de l'honneur.<br/>
                HOMMK est un jeu en ligne massivement multijoueur par navigateur edite par UBI soft.
                Heroes of Might and Magic : Kingdom est actuellement en phase de beta fermee.<br/>
            </span>
            <!-- google_ad_section_end -->
        </div>
        <script type="text/javascript">
            var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
            document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
        </script>
        <script type="text/javascript">
            try {
                var pageTracker = _gat._getTracker("UA-1694106-2");
                pageTracker._trackPageview();
            } catch(err) {}
        </script>
        <?php if (1 || isset($_POST["attacker_attack_level"])): ?>
        <script type="text/javascript">
            var battle_ajax;
            var tinyurl_ajax;

            function update_battle() {
                if (battle_ajax)
                    battle_ajax.abort();
                battle_ajax = $.ajax({
                    url : 'ajax_battlereport.php' ,
                    data : $('.battle_form').serialize(),
                    success : function(data){$(".slot_simulation").html(data)},
                    type : 'POST'
                });
            }
            $(document).ready(function() {

                $(".battle_form input, .battle_form select").change(update_battle);
                $(".battle_form input, .battle_form select").keyup(update_battle);
                $('.quantity').each(function(i){
                    var that = $(this);
                    that.find(".plus").click(function(){
                        if (!(that.find(".value").attr('value')))
                            that.find(".value").attr('value', 0);
                        that.find(".value").attr('value', parseInt(that.find(".value").attr('value')) + 1);
                        update_battle();
                    });
                    that.find(".minus").click(function(){
                        if (!(that.find(".value").attr('value')))
                            that.find(".value").attr('value', 0);
                        that.find(".value").attr('value', parseInt(that.find(".value").attr('value')) - 1);
                        if (that.find(".value").attr('value') < 0)
                            that.find(".value").attr('value', 0);
                        update_battle();
                    });
                })
            });
        </script>
        <?php endif; ?>

    </body>
</html>
